﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LeftMenu.ascx.cs" Inherits="RetailOnlineSite.UI.Shop.Register.LeftMenu" %>
<table width="100%" class="menu" cellspacing="0">
    <tr>
        <td class="menuheader">
            Tài khoản
        </td>
    </tr>
    <tr>
        <td id="personalinfo" class="menuitem">
            <a href="#pagepersonalinfo">Thông tin cá nhân</a>
        </td>
    </tr>
    <tr>
        <td id="changepassword" class="menuitem">
            <a href="#pagechangepassword">Đổi mật khẩu</a>
        </td>
    </tr>
</table>
<table width="200px" class="menu" cellspacing="0">
    <tr>
        <td class="menuheader">
            Bán hàng
        </td>
    </tr>
    <tr>
        <td id="shopinfo" class="menuitem">
            <a href="#pageshopinfo">Thông tin Shop</a>
        </td>
    </tr>
    <tr>
        <td id="productpost" class="menuitem">
            <a href="#pageproductpost">Đăng hàng</a>
        </td>
    </tr>
    <tr>
        <td id="manageproduct" class="menuitem">
            <a href="#pagemanageproduct">Quản lý sản phẩm</a>
        </td>
    </tr>
</table>
<table width="200px" class="menu" cellspacing="0">
    <tr>
        <td class="menuheader">
            Mua hàng
        </td>
    </tr>
    <tr>
        <td id="favouriteproduct" class="menuitem">
            <a href="#pagefavouriteproduct">Sản phẩm yêu thích</a>
        </td>
    </tr>
</table>

<script type="text/javascript">
    $(document).ready(function() {    // loaded page

        checkURL();    // check url and load page

        $('table tr td a').click(function(e) {    // execute

            checkURL(this.hash);    // ... check parameter on link ( ex. as #page1 )
        });

        setInterval("checkURL()", 250);    // test the change 250 ms

    });

    var lasturl = '';    //here we store the current URL hash

    function checkURL(hash) {
        if (!hash) hash = window.location.hash;    //if no parameter is provided, use the hash value from the current address

        if (hash != lasturl)    // if the hash value has changed
        {
            lasturl = hash;    //update the current hash
            var url = '' + hash.replace('#', '') + '.aspx';
            $('#pageContent').load(url);
            // loadPage(hash);    // and load the new page
        }
    } 
</script>

